package giro.general;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Handler;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.Toast;

public class ListBaseActivity extends ListActivity {
	protected Handler mHandler = new Handler();
	private LinearLayout mHomeToolbarLayout;

	protected void initToolbar() {
		LinearLayout fidatyToolbar = (LinearLayout) findViewById(R.id.home_toolbar);
		if (fidatyToolbar != null) {
			mHomeToolbarLayout = (LinearLayout) findViewById(R.id.home_layout);

			ImageButton homeButton = (ImageButton) mHomeToolbarLayout.findViewById(R.id.home_button);
			homeButton.setOnClickListener(new OnClickListener() {

				public void onClick(View v) {
					Intent intent = new Intent(ListBaseActivity.this, GiroItaliaActivity.class);
					startActivity(intent);
					finish();
				}

			});
		}
	}
	
	protected void postToast(final String toastMsg){
		mHandler.post(new Runnable() {

			public void run() {
				Toast.makeText(ListBaseActivity.this, toastMsg, Toast.LENGTH_SHORT).show();
			}
		});
	}
	
	

}
